Component({
    options: {
        multipleSlots: !0
    },
    properties: {
        coursePriceData: {
            type: Number
        },
        cancelText: {
            type: String,
            value: "取消"
        },
        confirmText: {
            type: String,
            value: "确定"
        }
    },
    data: {
        problem_msg: "",
        issueArr: [ "学生没有出席该课时", "教师没有出席该课时", "事先达成一致", "其他" ],
        solutionArr: [ "视该课时为正常完成。", "视该课时为未完成。在该课时包中补偿一个课时。" ],
        option0: {
            v: "S",
            t: "视该课时为正常完成。"
        },
        option1: {
            v: "TS",
            t: "视该课时为未完成。在该课时包中补偿一个课时。"
        }
    },
    ready: function(t) {
        if (!this.selectComponent) throw new Error("小程序sdk暂不支持节点操作selectComponent");
        this.baseModal = this.selectComponent("#baseModal");
    },
    methods: {
        bindIssueChange: function(t) {
            var e = Number(t.detail.value);
            switch (e) {
              case 0:
              case 1:
              case 2:
              case 3:
                this.data.solutionArr = [ this.data.option0, this.data.option1 ];
            }
            this.setData({
                issueIndex: e,
                solutionArr: this.data.solutionArr,
                solutionIndex: ""
            });
        },
        bindSolutionChange: function(t) {
            var e = Number(t.detail.value), s = this.data.solutionArr[e].v;
            this.setData({
                solutionIndex: e,
                nextStatus: s
            });
        },
        show: function() {
            this.triggerEvent("scrollEvent", {
                noScroll: !0
            }), this.baseModal.showModal();
        },
        hide: function() {
            this.triggerEvent("scrollEvent", {
                noScroll: !1
            }), this.baseModal.hideModal();
        },
        _cancelModal: function() {
            this.hide(), this.triggerEvent("cancelEvent");
        },
        bindTextAreaBlur: function(t) {
            void 0 !== t.detail.value && this.setData({
                problem_msg: t.detail.value
            });
        },
        _confirmModal: function(t) {
            if (this.problem_msg) this.setData({
                showReasonError: !0
            }); else {
                var e = this.data.refund_itc_usd, s = this.data.nextStatus;
                if ("S" == s && (e = 0), "TS" == s && (e = 100 * this.data.coursePriceData), void 0 !== e) var i = parseInt(e).toFixed();
                s = "CE", this.triggerEvent("confirmEvent", {
                    problem_msg: this.data.problem_msg,
                    problem_reason: 3 === this.data.issueIndex ? 100 : Number(this.data.issueIndex) + 1,
                    next_status: s,
                    refund_itc_usd: i
                }), this.hide();
            }
        }
    }
});